package com.leyou.item.api;

import com.leyou.item.pojo.Category;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@RequestMapping("category")
public interface CategoryApi {

    /**
     * 根据pid查询分类集合
     * @param pid
     * @return
     */
    @GetMapping("list")
    public List<Category> queryCategoriesByPid(@RequestParam(value="pid",defaultValue = "0") Long pid);


    /**
     * 根据分类id集合查询分类名字集合
     * @param ids
     * @return
     */
    @GetMapping
    public List<String> queryNameByIds(@RequestParam("ids")List<Long> ids);

}
